home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
TPUG Xtras
/
Xtras
/
club1.d64
/
draw poker64.9
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2009-02-07
|
6KB
|
379 lines
1 PRINT"[147]"
2 REM *** DRAW POKER BY DAVE HOWE
3 REM SUBMITTED BY ED HERSTEIN
4 REM
5 REM *** PET USER GROUP
6 REM SOFTWARE EXCHANGE
7 REM PO BOX 371
8 REM MONTGOMERYVILLE, PA 18936
9 REM **64 CHANGES BY FRED LAYBERGER, OMAHA NEBRASKA
10 DIMG1(5),F7(35),F8(35),F9(35)
20 DIMC5(6),C6(5),C7(5),C8(7),C9(52)
30 M$=" ":TX=54272:TC=11
40 P1=1024:P2=40:ZC=55296
45 POKE53280,5:POKE53281,1
50 W=0
60 PRINT"[147]";
70 PRINT"GET READY FOR DRAW POKER"
80 GOSUB5700
90 PRINT"[147][151]";
100 PRINT"LET'S PLAY DRAW POKER";
110 PRINTTAB(26);"HAND ODDS":PRINT
120 PRINTTAB(19);"ROYAL FLUSH:200 TO 1"
130 PRINTTAB(16);"STRAIGHT FLUSH:50 TO 1"
140 PRINTTAB(16);"FOUR OF A KIND:30 TO 1"
150 PRINTTAB(20);"FULL HOUSE:20 TO 1"
160 PRINTTAB(25);"FLUSH:10 TO 1"
170 PRINTTAB(22);"STRAIGHT:7 TO 1"
180 PRINTTAB(15);"THREE OF A KIND:5 TO 1"
190 PRINTTAB(22);"TWO PAIR:2 TO 1"
200 GOSUB5400
210 INPUT"PLACE YOUR BETS: HOW MANY DOLLARS[151]";D
212 IFD>10000GOTO5950
215 IFD<1GOTO5900
220 P=P1+15*P2
230 GOSUB 6000
240 M$="YOUR BET IS:"
250 L=LEN(M$)
260 P=P1+2*P2
270 GOSUB6100
280 M$="$"+STR$(D)
290 L=LEN(M$)
300 P=P1+3*P2
310 GOSUB6100
315 M$="YOU WIN":P=P1+31:GOSUB6100
320 FOR S=1TO8
330 GOSUB5200
340 P=P1+111+P2*(8-S)
350 L=8
360 M$="$"+STR$(W1)
370 GOSUB6100
380 NEXTS
390 GOSUB7000
400 FORY=1TO5
410 GOSUB7100
420 GOSUB2000
430 NEXTY
440 GOSUB8000
450 SX=S
460 GOSUB5100
500 M$="DO YOU WISH TO STAND? ENTER Y OR N"
510 P=P1+11*P2
520 GOSUB6000
530 GETQ$
540 IFQ$=""GOTO530
550 IFQ$="Y"GOTO1500
560 IFQ$="N"GOTO600
570 IFQ$<"0"GOTO530
580 IFQ$>"5"GOTO530
600 M$="INDICATE CARD TO HOLD BY ENTERING CARD #"
610 P=P1+11*P2
620 GOSUB6000
630 M$="TO CANCEL YOUR CHOICES, ENTER 'C'"
640 P=P1+12*P2
650 GOSUB6000
660 M$="WHEN READY FOR DRAW, PRESS RETURN KEY"
670 P=P1+13*P2
680 GOSUB6000
700 FORI=1TO5
710 G1(I)=0
720 NEXTI
730 P=P1+24*P2
740 GOSUB6000
750 IFQ$<>"C"GOTO810
800 GETQ$
810 IFQ$=""GOTO800
820 Q=ASC(Q$)
830 IFQ=13GOTO970
840 IFQ$="C"GOTO700
850 IFQ$<"1"GOTO800
860 IFQ$>"5"GOTO800
900 Y=VAL(Q$)
910 G1(Y)=1
920 P=P1+24*P2+2+8*(Y-1)
930 M$="HOLD"
940 L=LEN(M$)
950 GOSUB6100
960 GOTO800
970 P=P1+11*P2:GOSUB6000
980 P=P1+12*P2:GOSUB6000
990 P=P1+13*P2:GOSUB6000
1000 FORY=1TO5
1010 IFG1(Y)=0THENGOSUB5000
1020 NEXTY
1030 GOSUB8000
1040 IFSX=SGOTO1100
1050 GOSUB5100
1060 SX=S
1100 FORY=1TO5
1110 IFG1(Y)=1GOTO1140
1120 GOSUB7100
1130 GOSUB2000
1140 NEXTY
1150 GOSUB8000
1160 IFSX=SGOTO1200
1170 GOSUB5100
1180 SX=S
1190 GOSUB5100
1200 REM
1500 GOSUB5200
1510 W=W+W1
1520 IFW<0THENM$="YOUR TOTAL LOSES ARE $"+STR$(-W)
1530 IFW>=0THENM$="YOUR TOTAL WINNINGS ARE $"+STR$(W)
1540 P=P1+11*P2
1550 GOSUB6000
1600 X=300
1610 X=X-1
1612 GETG$
1614 IFG$<>""GOTO1900
1620 IFX>0GOTO1610
1900 GOTO90
2000 H=C2-7
2020 IFH<4THENH=1
2030 FORI=1TO7
2040 C8(I)=H
2050 NEXTI
2100 ONC2GOTO2110,2210,2200,2520,2410,2510,2500,2310,2400,2300,3000,3000,3000
2110 C8(4)=2
2120 GOTO3000
2200 C8(4)=2
2210 C8(2)=2:C8(6)=2
2230 GOTO3000
2300 C8(2)=2:C8(6)=2
2310 C8(3)=3:C8(5)=3
2320 GOTO2520
2400 C8(3)=3:C8(5)=3
2410 C8(4)=2
2420 GOTO2520
2500 C8(3)=2
2510 C8(4)=3
2520 C8(1)=3:C8(7)=3
3000 A=P1+15*P2+8*(Y-1)
3010 C3=(ASC(C2$)AND63)+128
3020 POKEA,C3:POKEA+TX,TC
3030 ZZ=15:ZX=160:A1=ZX
3050 E=6
3060 GOSUB4000
3065 IFC2=10THENPOKEA+1,ASC("0")+128:POKEA+1+TX,TC
3070 C4=ASC(C1$):REM -128
3072 F7(5)=C4:F7(31)=C4
3074 F8(1)=C4:F8(35)=C4
3076 F9(1)=C4:F9(35)=C4
3080 FORI=1TO7
3090 A=A+40
3100 POKEA,ZX:POKEA+TX,ZZ
3110 ONC8(I)GOSUB4100,4200,4300,4400,4500,4600
3120 POKEA+6,ZX:POKEA+6+TX,ZZ
3130 NEXTI
3140 A=A+39
3150 IFC2=10THENE=5
3160 GOSUB4000
3170 POKEA+E+1,C3:POKEA+E+1+TX,TC
3180 IFC2=10THENPOKEA+7,ASC("0")+128:POKEA+7+TX,TC
3190 C6(Y)=C1
3200 C7(Y)=C2
3300 RETURN
4000 FORI=1TOE
4010 POKEA+I,A1:POKEA+I+TX,ZZ
4020 A1=ZX
4030 NEXTI
4040 RETURN
4100 FORX=1TO5
4110 POKEA+X,ZX:POKEA+X+TX,ZZ
4120 NEXTX
4130 RETURN
4200 POKEA+1,ZX:POKEA+1+TX,ZZ
4210 POKEA+2,ZX:POKEA+2+TX,ZZ
4220 POKEA+3,C4:POKEA+3+TX,TC
4230 POKEA+4,ZX:POKEA+4+TX,ZZ
4240 POKEA+5,ZX:POKEA+5+TX,ZZ
4250 RETURN
4300 POKEA+1,C4:POKEA+1+TX,TC
4310 POKEA+2,ZX:POKEA+2+TX,ZZ
4320 POKEA+3,ZX:POKEA+3+TX,ZZ
4330 POKEA+4,ZX:POKEA+4+TX,ZZ
4340 POKEA+5,C4:POKEA+5+TX,TC
4350 RETURN
4400 FORX=1TO5
4410 X1=5*(I-1)+X
4420 POKEA+X,F7(X1):POKEA+X+TX,TC
4430 NEXTX
4440 RETURN
4500 FORX=1TO5
4510 X1=5*(I-1)+X
4520 POKEA+X,F8(X1):POKEA+X+TX,TC
4530 NEXTX
4540 RETURN
4600 FORX=1TO5
4610 X1=5*(I-1)+X
4620 POKEA+X,F9(X1):POKEA+X+TX,TC
4630 NEXTX
4640 RETURN
5000 REM CLEAR CARD
5010 A=P1+15*P2+8*(Y-1)-1
5020 FORI=1TO9
5030 FORX=1TO7
5040 POKEA+X,32
5050 NEXTX
5060 A=A+40
5070 NEXTI
5075 C6(Y)=15+2*Y
5078 C7(Y)=15+2*Y
5080 RETURN
5100 REM HIGHLIGHT SCREEN
5108 IFSX=0GOTO5190
5109 GOSUB9550:REM * BELL SOUND
5110 P=P1+94+P2*(8-SX)
5120 X=0
5130 FOR I=1TO24
5140 N=PEEK(P+I)
5150 IF(N=32)AND(X=0)GOTO5180
5160 X=1
5170 POKEP+I,(N+128)AND255:POKEP+I+TX,11
5180 NEXTI
5190 RETURN
5200 ONSGOTO5220,5240,5260,5280,5300,5320,5340,5360
5201 GOSUB9500:REM * BUZZER
5205 W1=-D
5210 RETURN
5220 W1=2*D
5230 RETURN
5240 W1=5*D
5250 RETURN
5260 W1=7*D
5270 RETURN
5280 W1=10*D
5290 RETURN
5300 W1=20*D
5310 RETURN
5320 W1=30*D
5330 RETURN
5340 W1=50*D
5350 RETURN
5360 W1=200*D
5370 RETURN
5400 PRINT
5410 IFW=0THENPRINT
5420 IFW<0THENPRINT"YOUR TOTAL LOSES ARE $";-W
5430 IFW>0THENPRINT"YOUR TOTAL WINNINGS ARE $";W
5440 PRINT:PRINT:PRINT
5450 RETURN
5500 F$=" _[160]) G*5T G[160][160][160] G[160][160][160]H [160][160][160]H Y64H [169][160][223] "
5510 RETURN
5530 F$=" )#T [169]G 5 [160][160][160][160];[160][160][160][160][160]<[160][160][160][160] 6 H) Y$[169] "
5540 RETURN
5560 F$=" _[160][160]) ' &B[169][160][160][160][188][160][160][160][160][160][187][160][160][160])]& % [169][160][160][223] "
5570 RETURN
5600 F7(X1)=F1
5620 RETURN
5630 F8(X1)=F1
5650 RETURN
5660 F9(X1)=F1
5680 RETURN
5700 FORX=1TO3
5710 FORX1=1TO35:
5715 PRINT"[147]":PRINT"GET READY FOR DRAW POKER"
5720 ONXGOSUB5500,5530,5560
5730 F1=ASC(MID$(F$,X1,1))
5740 IFF1<96GOTO5760
5750 IFF1<192THENF1=F1+64
5760 IFF1<64THENF1=F1+64
5770 F1=(F1+128)AND255
5780 ONXGOSUB5600,5630,5660
5790 NEXTX1
5800 NEXTX
5810 RETURN
5900 PRINT:PRINT"INVALID BET "
5910 GOTO5960
5950 PRINT:PRINT"BET TOO HIGH, HOUSE LIMIT IS $10,000"
5960 X=100
5970 X=X-1
5980 IFX>0GOTO5970
5990 GOTO90
6000 L=40
6100 A=P-1
6110 L1=LEN(M$)
6120 FORI=1TOL1
6125 M1$=MID$(M$,I,1)
6130 POKEA+I,ASC(M1$)AND63:POKEA+I+TX,.
6140 NEXTI
6150 A=A+L1
6160 L=L-L1
6170 IFL<=0GOTO6210
6180 FORI=1TOL
6190 POKEA+I,32
6200 NEXTI
6210 M$=" "
6220 RETURN
6336 K
7000 FORI=1TO52
7010 C9(I)=0
7030 NEXT I
7040 B1=0
7050 RETURN
7100 IFB1=52THENGOSUB7000
7120 C=INT(52*RND(1))
7130 IFC9(C+1)<>0GOTO7120
7140 B1=B1+1
7150 C9(C+1)=1
7160 C1=INT(C/13)+1
7170 C2=C-13*(C1-1)+1
7200 C1$=MID$("[193][211][218][216]",C1,1)
7205 IFC1$=CHR$(218)ORC1$=CHR$(211)THENTC=2
7206 IFC1$=CHR$(193)ORC1$=CHR$(216)THENTC=11
7210 C2$=MID$("A234567891JQK",C2,1)
7230 RETURN
8000 S=0
8010 S2=0
8020 FORI=1TO6
8030 C5(I)=100
8040 NEXTI
8050 FORI=1TO5
8060 X=5
8070 IFC7(I)>C5(X)GOTO8110
8080 C5(X+1)=C5(X)
8090 X=X-1
8100 IFX>0GOTO8070
8110 C5(X+1)=C7(I)
8120 NEXTI
8130 IFC5(1)=1THENC5(6)=14
8140 S1=0
8210 FORI=1TO4
8220 IFC6(I)=C6(I+1)THENS1=S1+1
8230 NEXTI
8240 IFS1=4THENS=4
8250 S1=0
8260 FORI=1TO5
8270 IFC5(I)+1=C5(I+1)THENS1=S1+1
8280 NEXTI
8290 IFS1=4THENS=S+S1-1
8300 IF(S=7)AND(C5(5)=13)THENS=S+1
8330 S1=-1
8340 FORI=1TO4
8350 IFC5(I)=C5(I+1)THENS1=S1+1
8360 IFC5(I)=C5(I+2)THENS1=S1+1
8370 NEXTI
8380 IFS1>2THENS1=S1+2
8390 IFS1>STHENS=S1
8400 RETURN
9000 FORI=1TO5
9010 INPUT"[156]ENTER SUIT #, CARD #";C6(I),C7(I)
9020 NEXTI
9030 GOSUB8000
9035 PRINT
9040 PRINT"S=";S
9044 PRINT
9045 PRINT"C5","C6","C7
9050 [129]I[178]1[164]6
9060 [153]C5(I),C6(I),C7(I)
9070 [130]I
9080 [137]9000
9500 [143] ** BUZZER
9505 [151]54296,15:[151]54277,45:[151]54278,165
9510 [151]54276,33:[151]54273,6:[151]54272,5
9515 [129]T[178]1[164]200:[130]:[151]54276,32:[151]54273,0:[151]54272,0:[142]
9550 [143] ** BELL SOUND
9555 [151]54296,15:[151]54277,0:[151]54278,247
9560 [151]54276,17:[151]54273,40:[151]54272,0
9565 [129]T[178]1[164]200:[130]:[151]54276,16:[151]54273,0:[151]54272,0:[142]